﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TraceLoggerManager
{
    public static class TraceLogger
    {
        public static void Trace(string category, string message)
        {
            System.Diagnostics.Trace.WriteLine(message, category);
        }

        public static void Error(string category, Exception ex)
        {
            StringBuilder message = new StringBuilder();
            message.AppendLine("Message:");
            message.AppendLine(ex.Message);
            if (ex.InnerException != null)
            {
                message.AppendLine("InnerException:");
                message.AppendLine(ex.InnerException.ToString());
            }

            System.Diagnostics.Trace.WriteLine(message.ToString(), category);
        }


    }
}
